<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link href="./jsp/user/style/expind-std.css" rel="stylesheet"
	type="text/css" />
<link href="./jsp/user/style/expind.css" rel="stylesheet"
	type="text/css" />
<script language="javascript"
	src="./jsp/user/scripts/jquery-1.8.2.min.js"></script>
<script language="javascript" src="./jsp/user/scripts/expind.js"></script>
</head>
<body>

	<div class="container_24">
		<jsp:include page="header.jsp" />
		<form action="edit-profile" method="post" name="editProfile" enctype="multipart/form-data">
			<div class="grid_24">
				<select id="profile-options">
					<option value="1" selected="selected">Display Profile</option>
					<option value="2" selected="selected">Edit Profile</option>
					<option value="3">Change Password</option>
				</select>
				<div class="grid_24 hr-line2"></div>
				<c:choose>
					<c:when test="${ empty updateError }">

					</c:when>
					<c:otherwise>
						<div style="color: red;">
							<c:out value="${updateError}"></c:out>
						</div>
						<br />
					</c:otherwise>
				</c:choose>

				<div class="grid_24 user-info">
					<div class="user-thumb">
						<img src="${user.imageURL}" alt="${user.name}" width="180px" /> <input
							type="file" name="datafile" size="40">or image URL <br />
						<input type="text" name="imageURL" value="${user.imageURL}"
							width="40">
						<div class="clear height20"></div>
					</div>
					<div class="title-style">
						<input
							style="color: black; font-size: 15px; font-family: courier new"
							type="text" name="firstname" value="${user.firstName}" width="40"><input
							style="color: black; font-size: 15px; font-family: courier new"
							type="text" name="surname" value="${user.lastName}" width="40">

						<div class="user-title"
							style="color: black; font-size: 15px; font-family: courier new">
							<c:forEach var="titlePair" items="${hasTitles}">
								<c:choose>
									<c:when test="${titlePair.value}">
										<input type="checkbox" name="title"
											value="${titlePair.key.titleName}" checked="checked">${titlePair.key.titleShowName}&nbsp;
								</c:when>
									<c:otherwise>
										<input type="checkbox" name="title"
											value="${titlePair.key.titleName}">${titlePair.key.titleShowName}&nbsp;
								</c:otherwise>

								</c:choose>
								<br>
							</c:forEach>
						</div>
					</div>

					<div class="availability-style"
						style="color: black; font-size: 15px; font-family: courier new">
						<c:choose>
							<c:when test="${user.available}">
								<input type="checkbox" name="availability" checked="checked" />
							</c:when>
							<c:otherwise>
								<input type="checkbox" name="availability" />
							</c:otherwise>
						</c:choose>
						Are you available?
					</div>
					<div class="info-style">
						<textarea name="description" rows="7" cols="92">
			  		<c:out value="${ user.summary}" /> 
			  	</textarea>
						<table
							style="color: black; font-size: 15px; font-family: courier new">
							<tr>
								<td>
									<table>
										<tr>
											<td>Email</td>
											<td>${user.email }</td>
										</tr>
										<tr>
											<td>Birth date</td>
											<td><jsp:include page="date.jsp" /></td>
										</tr>
										<tr>
											<td>City</td>
											<td><input type="text" name="city" value="${user.city }"
												style="margin: 5px 20px" /></td>
										</tr>
										<tr>
											<td>Tel</td>
											<td><input type="text" name="tel"
												value=<c:if test="${user.tel ne -1 }">${user.tel}</c:if>
												style="margin: 5px 20px" /> (only digits)</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<div id="actor-properties">
										<c:choose>
											<c:when test="${empty user.actorFeatures}">

											</c:when>
											<c:otherwise>

												<jsp:include page="actor-properties.jsp" />

											</c:otherwise>
										</c:choose>
									</div>
								</td>
							</tr>
						</table>
					</div>
				</div>
			</div>
			<input style="float: right;" type="button"
				onclick="javascript:editProfileValidation()" value="Save" /> <input
				style="float: right;" type="button" value="Cancel"
				onclick="window.location.href='user?who=me';" />
		</form>
	</div>
</body>
</html>